package com.recallgo.manage.service.impl;

import com.recallgo.manage.entity.ItemParam;
import com.recallgo.manage.mapper.ItemParamMapper;
import com.recallgo.manage.service.ItemParamService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 商品规则参数 服务实现类
 * </p>
 *
 * @author fendo
 * @since 2018-09-11
 */
@Service
public class ItemParamServiceImpl extends ServiceImpl<ItemParamMapper, ItemParam> implements ItemParamService {

    @Autowired
    private ItemParamService itemParamService;

    public void saveItem(Long itemCatId, String paramData){
        ItemParam itemParam = new ItemParam();
        itemParam.setId(null);
        Date date = new Date();
        itemParam.setItemCatId(itemCatId);
        itemParam.setParamData(paramData);
        itemParam.setCreated(date);
        itemParam.setUpdated(date);
        itemParamService.insert(itemParam);
    }
}
